﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
/// Summary description for ProductBus
/// </summary>
public class ProductBus
{
    private ProductDAL ProductDAL = new ProductDAL();

	public ProductBus()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public DataTable GetAllProduct()
    {
        return ProductDAL.GetAllProduct();
    }

    public DataTable GetProductByID(int id)
    {
        return ProductDAL.GetProductByID(id);
    }

    public DataTable GetProductByCategory(int cat_id)
    {
        return ProductDAL.GetProductByCategory(cat_id);
    }

    public DataTable SearchProduct(String pd_name)
    {
        return ProductDAL.searchProductByName(pd_name);
    }

    public DataTable SearchProductByPrice(decimal pd_price)
    {
        return ProductDAL.searchProductByPrice(pd_price);
    }

    public bool InsertProduct(Product objProduct)
    {
        return ProductDAL.InsertProduct(objProduct);
    }

    public bool UpdateProduct(Product objProduct)
    {
        return ProductDAL.UpdateProduct(objProduct);
    }

    public bool DeleteProduct(int pdID)
    {
        return ProductDAL.DeleteProduct(pdID);
    }

    public bool UpdateVisitProduct(int pd_id, int pd_visit)
    {
        return ProductDAL.UpdateVisitProduct(pd_id,pd_visit);
    }

    public DataTable GetVisitProduct(int pd_id)
    {
        return ProductDAL.GetVisitProduct(pd_id);
    }

    public bool UpdateOrderNum(int pd_id, int pd_ordernum)
    {
        return ProductDAL.UpdateOrderNum(pd_id, pd_ordernum);
    }

    public DataTable GetOrderNum(int pd_ordernum)
    {
        return ProductDAL.GetOrderNum(pd_ordernum);
    }
}
